<#import "/freemarker/modeltype.ftl" as mt>
<#import "/freemarker/modeltype_entity.ftl" as mte>
<#if tmList?? && (tmList?size > 0)>
<div class="panel-heading">
	培训资料
</div>
<div style="overflow: auto;">
	<table class="table table-bordered" style="width: 500px;">
		<!-- 优先显示合格的  -->
		<#list tmList as tm>
		<tr>
			<td>资料名称：</td>
			<td colspan="2" style="text-align: center;">${(tm.name)!''}</td>
		</tr>
		<tr>
			<td style="width: 80px;">附件:</td>
			<td>
				<#list tm.list as tma>
					<div class="filter-table rep" style="margin-left:5px; margin-bottom:0px;">
						<a class="title" target="_blank" href="javascript:;" onclick="javascript: learnMaterialAnnex('${classCode}', '${courseCode}', '${tm.code}', '${tma.code}', '${contextPath}upload/data/${tma.sn}.${tma.ext}'); return false;">${tma.name}</a>
					</div>
					:学习${(tma.total)!'0'}分钟
				</#list>
			</td>
		</tr>
		</#list>
	</table>
</div>
</#if>
<!-- 考试及及考试记录 -->
<#if erList?? && (erList?size > 0)>
<table class="table table-bordered" style="width: 500px;">
	<#if ccr??>考试说明:&nbsp;&nbsp;
	<#if ccr.total??>卷面总分(${(ccr.total)!'0'}分)</#if>
	<#if ccr.qualifiedSocre??>/合格分${(ccr.qualifiedSocre)!''}</#if>
	<#if ccr.examTime??>/时间(${(ccr.examTime)!''}分钟)</#if>
	<#if ccr.num??>/次数(${(ccr.num)!''}次)</#if>
	<#if erList?? && (erList?size > 0)>/已使用(${erList?size}次)</#if>
	</#if>
	<span style="margin-top: -7px;">
	<#if isExam?? && isExam && isMarke?? && isMarke = 1 && isPass?? && isPass = 1>
		<br><button class="btn btn-xs btn-info" onclick="javascript: exam('${classCode}', '${courseCode}', '${ccr.num}', '${erList?size}'); return false;">开始考试</button>
	<#elseif isMarke?? && isMarke = 2>
		<br><span style="color: red;font-size: 10px;">还有未阅卷的哦！</span>
	<#elseif isPass?? && isPass = 2>
		<br><span  style="color: red;font-size: 10px;">已经通过了，不用考试了</span>
	<#else>
		<br><span style="font-size: 20px;color: green;">考试日期:
			<#if c.beginTime?? && c.finishTime??>
				<#if c.beginTime == c.finishTime>${(c.beginTime?string('yyyy-MM-dd'))!''}<#else>${(c.beginTime?string('yyyy-MM-dd'))!''}至${(c.finishTime?string('yyyy-MM-dd'))!''}</#if>
			<#elseif c.beginTime?? && !c.finishTime??>${(c.beginTime?string('yyyy-MM-dd'))!''}后
			<#elseif c.finishTime?? && !c.beginTime??>${(c.beginTime?string('yyyy-MM-dd'))!''}前
			</#if>
		</span>
	</#if>
	</span>
</table>
<div style="height: <#if (erList?size <= 6)>auto;<#else>345px;</#if>overflow: auto;">
	<table class="table table-bordered" style="width: 500px;">
		<thead>
			<tr>
				<th>考试时间</th>
				<th>得分</th>
				<th>是否合格</th>
				<th>阅卷人</th>
				<th>答题记录 </th>
			</tr>
		</thead>
		<tbody>
			<!-- 优先显示合格的  -->
			<#list erList as er>
				<#if er.isPass?? && er.isPass>
				<tr style="display: table-row;">
					<td>${(er.ct)!''}</td>
					<td style="text-align: center;">${(er.examScore)!''}</td>
					<td style="text-align: center;" ><i style="color: green;" class=" icon-thumbs-up"></i></td>
					<td style="text-align: center;"><#if er.isMark>${(er.markCun)!'还没阅卷'}<#else>无需阅卷</#if></td>
					<td style="text-align: center;" >
						<button class="btn btn-info" onclick="javascript: openExamRecord('${er.code}'); return false;"><i class="icon-book"></i></button>
					</td>
				</tr>
				</#if>
			</#list>
			<!-- 显示不合格的 -->
			<#list erList as er>
				<#if !er.isPass>
				<tr style="display: table-row;">
					<td>${(er.ct)!''}${er.isMark}</td>
					<td style="text-align: center;">${(er.examScore)!''}</td>
					<td style="text-align: center;"><i style="color: red;" class="icon-thumbs-down"></i></td>
					<td style="text-align: center;"><#if er.isMark>${(er.markCun)!'还没阅卷'}<#else>无需阅卷</#if></td>
					<td style="text-align: center;">
						<button class="btn btn-info" onclick="javascript: openExamRecord('${er.code}'); return false;"><i class="icon-book"></i></button>
					</td>
				</tr>
				</#if>
			</#list>
		</tbody>
	</table>
</div>
<#else>
	<div class="ng-binding">考试说明</div>
	<table class="table table-bordered" style="width: 500px;">
		<tr>
			<td>考试日期</td>
			<td>
				<#if c.beginTime?? && c.finishTime??>
					<#if c.beginTime == c.finishTime>${(c.beginTime?string('yyyy-MM-dd'))!''}<#else>${(c.beginTime?string('yyyy-MM-dd'))!''}至${(c.finishTime?string('yyyy-MM-dd'))!''}</#if>
				<#elseif c.beginTime?? && !c.finishTime??>${(c.beginTime?string('yyyy-MM-dd'))!''}后
				<#elseif c.finishTime?? && !c.beginTime??>${(c.beginTime?string('yyyy-MM-dd'))!''}前
				</#if>
			</td>
		</tr>
		<tr>
			<td>卷面总分</td>
			<td>${(ccr.total)!'0'}分</td>
		</tr>
		<tr>
			<td>考试时间</td>
			<td>${(ccr.examTime)!''}分钟</td>
		</tr>
		<tr>
			<td>合格分</td>
			<td>${(ccr.qualifiedSocre)!''}分</td>
		</tr>
		<tr>
			<td>次数</td>
			<td>${(ccr.num)!''}次</td>
		</tr>
		<tr>
			<td colspan="2">
			<#if isExam?? && isExam && isMarke = 1>
			<div class="form-group m-b-sm" style="text-align: center;">
				<button class="btn btn-xs btn-info" onclick="javascript: exam('${classCode}', '${courseCode}', '${ccr.num}', '0'); return false;">开始考试</button>
			</div>
			</#if>
			</td>
		</tr>
	</table>
</#if>